import json


class Currm:
    def __init__(self,id,name,teacherName,plan,credit,time,position):
        self.id = id
        self.name = name
        self.teacherName = teacherName
        self.plan = plan
        self.credit = credit
        self.time = time
        self.position = position

    @staticmethod
    def result_to_json(result):
        entity = Currm(result[0], result[1], result[2], result[3], result[4], result[5], result[6])
        return json.dumps(entity.__dict__)

    @staticmethod
    def result_to_entity(result):
        entity = Currm(result[0], result[1], result[2], result[3], result[4], result[5], result[6])
        return entity

    @staticmethod
    def result_to_entity_dict(result):
        entity = Currm(result[0], result[1], result[2], result[3], result[4], result[5], result[6])
        return entity.__dict__
